Skip to content

Conversation

@ipochi
Copy link
Contributor

@ipochi ipochi commented Sep 19, 2025

This reverts commit 4ce5f06.

This commit reverts a previous modification to the flag handling logic in the agent and server's main() functions.

A prior change introduced a condition (if local.Lookup("v") == nil) before setting the default klog verbosity level. This condition was incorrect because klog.InitFlags() always defines the -v flag, meaning the default verbosity was never being applied. This caused the effective log level to fall back to klog's default of 0 instead of the intended 4.

This change restores the original, correct behavior by unconditionally setting the verbosity to 4. This ensures logs are visible by default while still allowing the user to override the setting via the command line.

#685 (comment)

Fixes: #780

…g-level-from-args"

This reverts commit 4ce5f06.

This commit reverts a previous modification to the flag handling logic
in the agent and server's main() functions.

A prior change introduced a condition (`if local.Lookup("v") == nil`)
before setting the default klog verbosity level. This condition was
incorrect because `klog.InitFlags()` always defines the `-v` flag,
meaning the default verbosity was never being applied. This caused the
effective log level to fall back to klog's default of `0` instead of the
intended `4`.

This change restores the original, correct behavior by unconditionally
setting the verbosity to `4`. This ensures logs are visible by default
while still allowing the user to override the setting via the command
line.
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Sep 19, 2025
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 19, 2025
Copy link
Contributor

@makhov makhov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like the idea of reverting this. Now we just have a default level 0, which I'm personaly quite ok with. Reverting this will mean that we have a hardcoded level 4.

The proper fix sill be just to change the order of the check and InitFlags. I'll try to do it asap

@ipochi
Copy link
Contributor Author

ipochi commented Sep 19, 2025

I don't like the idea of reverting this. Now we just have a default level 0, which I'm personaly quite ok with. Reverting this will mean that we have a hardcoded level 4.

The proper fix sill be just to change the order of the check and InitFlags. I'll try to do it asap

I don't understand what's wrong with the below line

The default is 4 and if you pass any thing it will be respected.

@makhov
Copy link
Contributor

makhov commented Sep 19, 2025

You right. Sorry, I misunderstood the current flow.

@cheftako
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 19, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cheftako, ipochi, makhov

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit 18deb66 into kubernetes-sigs:release-0.33 Sep 19, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants